package com.mvc.controller;

import com.mvc.beans.Admin;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * @author a1926
 */
@Controller
public class LoginController {
    @RequestMapping("/")
    public String index(){
        return new String("index");
    }

    @RequestMapping(value = "/success")
    public String singUp(Admin user, HttpSession httpSession){
        //待修改
        if("admin".equals(user.getName())&& "123456".equals(user.getPassWord())){
            httpSession.setAttribute("UserName",user.getName());
        }
        return new String("main");
    }
}
